.class public abstract Lcom/estrongs/android/dlna/a;
.super Ljava/lang/Object;
.source "ESAudioPlayerProxy.java"

# interfaces
.implements Lcom/estrongs/dlna/render/player/b;


# instance fields
.field private a:Landroid/media/AudioManager;

.field private b:Lcom/estrongs/dlna/render/player/a;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    invoke-direct {p0, p1}, Lcom/estrongs/android/dlna/a;->a(Landroid/content/Context;)V

    return-void
.end method

.method private a(I)V
    .locals 3

    .line 6
    iget-object v0, p0, Lcom/estrongs/android/dlna/a;->a:Landroid/media/AudioManager;

    if-eqz v0, :cond_0

    const/4 v1, 0x3

    const/4 v2, 0x0

    .line 7
    invoke-virtual {v0, v1, p1, v2}, Landroid/media/AudioManager;->setStreamVolume(III)V

    :cond_0
    return-void
.end method

.method private a(Landroid/content/Context;)V
    .locals 1

    .line 3
    iget-object v0, p0, Lcom/estrongs/android/dlna/a;->a:Landroid/media/AudioManager;

    if-nez v0, :cond_0

    :try_start_0
    const-string v0, "audio"

    .line 4
    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Landroid/media/AudioManager;

    iput-object p1, p0, Lcom/estrongs/android/dlna/a;->a:Landroid/media/AudioManager;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception p1

    .line 5
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    :cond_0
    :goto_0
    return-void
.end method

.method private c()I
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/dlna/a;->a:Landroid/media/AudioManager;

    if-eqz v0, :cond_0

    const/4 v1, 0x3

    .line 2
    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->getStreamVolume(I)I

    move-result v0

    return v0

    :cond_0
    const/16 v0, 0x32

    return v0
.end method

.method private d()I
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/dlna/a;->a:Landroid/media/AudioManager;

    if-eqz v0, :cond_0

    const/4 v1, 0x3

    .line 2
    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->getStreamMaxVolume(I)I

    move-result v0

    return v0

    :cond_0
    const/16 v0, 0x64

    return v0
.end method


# virtual methods
.method public a(F)V
    .locals 3

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/dlna/a;->d()I

    move-result v0

    int-to-float v1, v0

    mul-float v1, v1, p1

    float-to-int v1, v1

    const/4 v2, 0x0

    cmpg-float v2, p1, v2

    if-ltz v2, :cond_1

    const/high16 v2, 0x42c80000    # 100.0f

    cmpl-float p1, p1, v2

    if-lez p1, :cond_0

    goto :goto_0

    :cond_0
    move v0, v1

    .line 2
    :cond_1
    :goto_0
    invoke-direct {p0, v0}, Lcom/estrongs/android/dlna/a;->a(I)V

    return-void
.end method

.method public b()Lcom/estrongs/dlna/render/player/a;
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/dlna/a;->b:Lcom/estrongs/dlna/render/player/a;

    if-nez v0, :cond_0

    .line 2
    new-instance v0, Lcom/estrongs/android/dlna/e;

    invoke-direct {v0}, Lcom/estrongs/android/dlna/e;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/dlna/a;->b:Lcom/estrongs/dlna/render/player/a;

    .line 3
    :cond_0
    iget-object v0, p0, Lcom/estrongs/android/dlna/a;->b:Lcom/estrongs/dlna/render/player/a;

    return-object v0
.end method

.method public getVolume()F
    .locals 2

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/dlna/a;->c()I

    move-result v0

    .line 2
    invoke-direct {p0}, Lcom/estrongs/android/dlna/a;->d()I

    move-result v1

    int-to-float v0, v0

    int-to-float v1, v1

    div-float/2addr v0, v1

    return v0
.end method
